Added a check to not emit a "changed" signal when an already invalid
authorMichael Hasselmann <michaelh@openismus.com>
Sun, 22 Feb 2009 17:21:37 +0000 (17:21 +0000)
committerMathias Hasselmann <hasselmm@src.gnome.org>
Sun, 22 Feb 2009 17:21:37 +0000 (17:21 +0000)
2009-02-19  Michael Hasselmann <michaelh@openismus.com>

* gtk/gtkcombobox.c (gtk_combo_box_set_active_internal):
Added a check to not emit a "changed" signal when an already
invalid selection was set to invalid.

svn path=/trunk/; revision=22390

ChangeLog
gtk/gtkcombobox.c

index eae5c630f771823e2286782d05cde1236d5edf37..aef3918edcd73b0c1bd9429b0c7a41b96541ac82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-19  Michael Hasselmann <michaelh@openismus.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_set_active_internal):
+       Added a check to not emit a "changed" signal when an already invalid
+       selection was set to invalid.
+
 2009-02-22  Matthias Clasen <mclasen@redhat.com>
 
        * gtk/gtk.symbols:
index d0d73fcd58ddda5dff6f7462911764f5b04636a0..57a975d0ef8a3074d9d5ceac048bdc02989383f9 100644 (file)
@@ -4866,7 +4866,10 @@ gtk_combo_box_set_active_internal (GtkComboBox *combo_box,
   GtkTreePath *active_path;
   gint path_cmp;
 
-  if (path && gtk_tree_row_reference_valid (priv->active_row))
+  /* Remember whether the initially active row is valid. */
+  gboolean is_valid_row_reference = gtk_tree_row_reference_valid (priv->active_row);
+
+  if (path && is_valid_row_reference)
     {
       active_path = gtk_tree_row_reference_get_path (priv->active_row);
       path_cmp = gtk_tree_path_compare (path, active_path);
@@ -4895,6 +4898,13 @@ gtk_combo_box_set_active_internal (GtkComboBox *combo_box,
 
       if (priv->cell_view)
         gtk_cell_view_set_displayed_row (GTK_CELL_VIEW (priv->cell_view), NULL);
+
+      /*
+       *  Do not emit a "changed" signal when an already invalid selection was
+       *  now set to invalid.
+       */
+      if (!is_valid_row_reference)
+        return;
     }
   else
     {